package com.wiim.model;

import java.io.Serializable;
import java.util.Map;
/*
 * USER MODEL
 */
@SuppressWarnings("serial")
public class UserModel implements Serializable {

	private String sUserName, sPassword, sEmail, sName, sPhone, sMobilePhone, sBirthday, sGender, sCreateDate, sUpdateDay, sUpdateProfile, sTatus, sAddressDelivery, sAddress, sCountStoreLike, sIDRole;
	private String sUrlImage, sImage;
	private int user_id;
	private String sPoint;
	private String sLike;
	private String sDelivery;
	private String sOrder;
	private String sPayment;
	private String sLoginType;

	public String getLoginType() {
		if (null == sLoginType) {
			return "";
		} else {
			return sLoginType;
		}
	}

	public void setLoginType(String sLoginType) {
		this.sLoginType = sLoginType;
	}

	//
	// public void setUserName(String sUserName) {
	// this.sUserName = sUserName;
	// }

	public void setEmail(String sEmail) {
		this.sEmail = sEmail;
	}

	public void setName(String sName) {
		this.sName = sName;
	}

	public void setPhone(String sPhone) {
		this.sPhone = sPhone;
	}

	public void setMobilePhone(String sMobilePhone) {
		this.sMobilePhone = sMobilePhone;
	}

	public void setBirthday(String sBirthday) {
		this.sBirthday = sBirthday;
	}

	public void setGender(String sGender) {
		this.sGender = sGender;
	}

	public void setCreateDate(String sCreateDate) {
		this.sCreateDate = sCreateDate;
	}

	public void setUpdateDay(String sUpdateDay) {
		this.sUpdateDay = sUpdateDay;
	}

	public void setUpdateProfile(String sUpdateProfile) {
		this.sUpdateProfile = sUpdateProfile;
	}

	public void setTatus(String sTatus) {
		this.sTatus = sTatus;
	}

	public void setAddressDelivery(String sAddressDelivery) {
		this.sAddressDelivery = sAddressDelivery;
	}

	public void setAddress(String sAddress) {
		this.sAddress = sAddress;
	}

	public void setCountStoreLike(String sCountStoreLike) {
		this.sCountStoreLike = sCountStoreLike;
	}

	public void setIDRole(String sIDRole) {
		this.sIDRole = sIDRole;
	}

	public void setUrlImage(String sUrlImage) {
		this.sUrlImage = sUrlImage;
	}

	public void setImage(String sImage) {
		this.sImage = sImage;
	}

	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}

	public void setPoint(String sPoint) {
		this.sPoint = sPoint;
	}

	public void setLike(String sLike) {
		this.sLike = sLike;
	}

	public void setDelivery(String sDelivery) {
		this.sDelivery = sDelivery;
	}

	public void setOrder(String sOrder) {
		this.sOrder = sOrder;
	}

	public void setPayment(String sPayment) {
		this.sPayment = sPayment;
	}

	public int getUserID() {
		return user_id;
	}

	public String getPoint() {
		return sPoint;
	}

	public String getLike() {
		return sLike;
	}

	public String getDelivery() {
		return sDelivery;
	}

	public String getOrder() {
		return sOrder;
	}

	public String getPayment() {
		return sPayment;
	}

	public String getUserName() {
		if (sUserName == null) {
			sUserName = "";
		}
		return sUserName;
	}

	public String getPassword() {
		if (sPassword == null) {
			sPassword = "";
		}
		return sPassword;
	}

	public void setPassword(String sPassword) {
		this.sPassword = sPassword;
	}

	public String getEmail() {
		if (sEmail == null) {
			sEmail = "";
		}
		return sEmail;
	}

	public String getName() {
		if (sName == null) {
			sName = "";
		}
		return sName;
	}

	public String getPhone() {
		if (sPhone == null) {
			sPhone = "";
		}
		return sPhone;
	}

	public String getAddressDelivery() {
		if (sAddressDelivery == null) {
			sAddressDelivery = "";
		}
		return sAddressDelivery;
	}

	public String getAddress() {
		if (sAddress == null) {
			sAddress = "";
		}
		return sAddress;
	}

	public String getCountStoreLike() {
		if (sCountStoreLike == null) {
			sCountStoreLike = "";
		}
		return sCountStoreLike;
	}

	public String getIDRole() {
		if (sIDRole == null) {
			sIDRole = "";
		}
		return sIDRole;
	}

	public String getMobilePhone() {
		if (sMobilePhone == null) {
			sMobilePhone = "";
		}
		return sMobilePhone;
	}

	public String getBirthday() {
		if (sBirthday == null) {
			sBirthday = "";
		}
		return sBirthday;
	}

	public String getGender() {
		if (sGender == null) {
			sGender = "";
		}
		return sGender;
	}

	public String getCreateDate() {
		if (sCreateDate == null) {
			sCreateDate = "";
		}
		return sCreateDate;
	}

	public String getUpdateDay() {
		if (sUpdateDay == null) {
			sUpdateDay = "";
		}
		return sUpdateDay;
	}

	public String getUpdateProfile() {
		if (sUpdateProfile == null) {
			sUpdateProfile = "";
		}
		return sUpdateProfile;
	}

	public String getTatus() {
		if (sTatus == null) {
			sTatus = "";
		}
		return sTatus;
	}

	public String getUrlImage() {
		if (sUrlImage == null) {
			sUrlImage = "";
		}
		return sUrlImage;
	}

	public String getImage() {
		if (sImage == null) {
			sImage = "";
		}
		return sImage;
	}

	private String sCountAllComment;

	public String getCountAllComment() {
		return sCountAllComment;
	}

	public void setData(Map<String, Object> mapInfo, Boolean isLogin) {
		if (isLogin) {
			this.user_id = Integer.parseInt(mapInfo.containsKey("id_user") ? mapInfo.get("id_user").toString() : "-1");
			this.sEmail = mapInfo.containsKey("email") ? mapInfo.get("email").toString() : "";
			this.sUserName = mapInfo.containsKey("username") ? mapInfo.get("username").toString() : "";
			this.sName = mapInfo.containsKey("fullname") ? mapInfo.get("fullname").toString() : "";
			this.sMobilePhone = mapInfo.containsKey("mobilephone") ? mapInfo.get("mobilephone").toString() : "";
			this.sPhone = mapInfo.containsKey("phone") ? mapInfo.get("phone").toString() : "";
			this.sBirthday = mapInfo.containsKey("birthday") ? mapInfo.get("birthday").toString() : "";
			this.sGender = mapInfo.containsKey("gender") ? mapInfo.get("gender").toString() : "";
			this.sAddressDelivery = mapInfo.containsKey("addressdelivery") ? mapInfo.get("addressdelivery").toString() : "";
			this.sAddress = mapInfo.containsKey("address") ? mapInfo.get("address").toString() : "";
			this.sImage = mapInfo.containsKey("avartar") ? mapInfo.get("avartar").toString() : "";
			this.sPoint = mapInfo.containsKey("point") ? mapInfo.get("point").toString() : "";
			this.sCountStoreLike = mapInfo.containsKey("countstorelike") ? mapInfo.get("countstorelike").toString() : "";
			this.sCreateDate = mapInfo.containsKey("createdate") ? mapInfo.get("createdate").toString() : "";
			this.sUpdateDay = mapInfo.containsKey("updatedate") ? mapInfo.get("updatedate").toString() : "";
			this.sTatus = mapInfo.containsKey("status") ? mapInfo.get("status").toString() : "";
			this.sUrlImage = mapInfo.containsKey("url_image") ? mapInfo.get("url_image").toString() : "";
			this.sIDRole = mapInfo.containsKey("id_role") ? mapInfo.get("id_role").toString() : "";
		} else {
			this.user_id = Integer.parseInt(mapInfo.containsKey("id_user") ? mapInfo.get("id_user").toString() : "-1");
			this.sPhone = mapInfo.containsKey("phone") ? mapInfo.get("phone").toString() : "";
			this.sMobilePhone = mapInfo.containsKey("mobilephone") ? mapInfo.get("mobilephone").toString() : "";
			this.sBirthday = mapInfo.containsKey("birthday") ? mapInfo.get("birthday").toString() : "";
			this.sGender = mapInfo.containsKey("gender") ? mapInfo.get("gender").toString() : "";
			this.sPoint = mapInfo.containsKey("point") ? mapInfo.get("point").toString() : "";
			this.sLike = mapInfo.containsKey("like") ? mapInfo.get("like").toString() : "";
			this.sDelivery = mapInfo.containsKey("delivery") ? mapInfo.get("delivery").toString() : "";
			this.sOrder = mapInfo.containsKey("order") ? mapInfo.get("order").toString() : "";
			this.sPayment = mapInfo.containsKey("payment") ? mapInfo.get("payment").toString() : "";
			this.sUrlImage = mapInfo.containsKey("url_image") ? mapInfo.get("url_image").toString() : "";
		}
	}
}
